package com.sc.fanshe;

import java.lang.reflect.Field;

public class Sington {
    private static Sington instance;
    private String str = "abc";

    private Sington() {
    }

    public static Sington getInstance() {
        if (instance == null) {
            return instance = new Sington();
        }
        return instance;
    }


    public static void main(String[] args) {
        try {
            Sington sington = Sington.getInstance();
            Field a = sington.getClass().getDeclaredField("str");
            a.setAccessible(true);
            System.out.println(Sington.getInstance().str);
            a.set(sington, "123");
            System.out.println(Sington.getInstance().str);
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}
